home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
021-030
/
amok21
/
iffsupport1.5
/
demos
/
showovsc.mod
< prev
next >
Wrap
Text File
|
1993-11-04
|
3KB
|
88 lines
(*---------------------------------------------------------------------------
:Program. ShowOvsc.mod
:Author. Fridtjof Siebert
:Address. Nobileweg 67, D-7000 Stuttgart 40
:Phone. (0)711/822509
:Shortcut. [fbs]
:Version. 1.0
:Date. 26-Feb-89
:Copyright. PD
:Language. Modula-II
:Translator. M2Amiga v3.1d
:Imports. IFFSupport [fbs].
:UpDate. none.
:Contents. Demo zu IFFSupport für Overscan-Colorcycling-Bilder.
:Remark. Syntax: ShowOvsc <filename>
---------------------------------------------------------------------------*)
MODULE ShowOvsc;
FROM SYSTEM IMPORT ADR;
FROM Arguments IMPORT NumArgs, GetArg;
FROM Graphics IMPORT GfxBasePtr, ViewModes;
FROM Intuition IMPORT ScreenPtr, CloseScreen, DisplayBeep, WindowPtr, MakeScreen,
RethinkDisplay;
FROM IFFSupport IMPORT ReadILBM, ReadILBMFlags, ReadILBMFlagSet, DoCycle, EndCycle,
IFFInfo, NuScreen;
FROM Dos IMPORT Delay;
IMPORT Graphics;
CONST
minvx = -31;
maxvx = 0;
minvy = -19;
maxvy = 12;
author = "ShowOvsc, © 1989 by Fridtjof Siebert / AMOK Stuttgart";
VAR
MyScreen: ScreenPtr; (* the Picture's ScreenPointer *)
WindowDummy: WindowPtr; (* only a dummy for NIL-Windowpointer *)
Name: ARRAY[0..79] OF CHAR; (* the Picture's Name *)
length: INTEGER; (* dummy for receiving Name's Length *)
Ciapra [0BFE001H]: SET OF (s0,s1,s2,s3,s4,s5,lmb);
gfx: GfxBasePtr;
BEGIN
(*------ Get Name: ------*)
IF NumArgs()#0 THEN GetArg(1,Name,length) ELSE HALT END;
gfx := ADR(Graphics);
(*------ Read and Show Pic: ------*)
IF ReadILBM(Name,ReadILBMFlagSet{front},MyScreen,WindowDummy) THEN
WITH MyScreen^.viewPort DO
dxOffset := IFFInfo.BMHD.width;
dyOffset := IFFInfo.BMHD.height;
IF NOT(hires IN NuScreen.viewModes) THEN INC(dxOffset,dxOffset) END;
IF lace IN NuScreen.viewModes THEN dyOffset := dyOffset DIV 2 END;
dxOffset := (ORD(gfx^.normalDisplayColumns) - dxOffset) DIV 2;
dyOffset := (ORD(gfx^.normalDisplayRows) - dyOffset) DIV 2;
IF dyOffset<-16 THEN dyOffset := -16 ELSIF dyOffset>200 THEN dyOffset := 200 END;
IF dxOffset<-32 THEN dxOffset := -32 ELSIF dxOffset>704 THEN dxOffset := 704 END;
IF NOT(hires IN NuScreen.viewModes) THEN dxOffset := dxOffset DIV 2 END;
IF lace IN NuScreen.viewModes THEN INC(dyOffset,dyOffset) END;
END;
MakeScreen(MyScreen); RethinkDisplay();
(*------ start ColorCycling: ------*)
IF DoCycle(ADR(IFFInfo),MyScreen) THEN END;
WHILE lmb IN Ciapra DO Delay(3) END;
(* that's bad style, but it's the easiest way to wait for left Button *)
(*------ stop ColorCycling (this mustn't be forgotten !!!) ------*)
EndCycle(ADR(IFFInfo));
CloseScreen(MyScreen); (* close the Screen *)
ELSE
DisplayBeep(NIL); (* any error occured: lets display a Beep ! *)
END;
END ShowOvsc. That's all. Wasn't that easy ???